package com.itheima.app.controller;

import com.itheima.app.service.UserService;
import com.itheima.health.model.common.R;
import com.itheima.health.model.pojos.PhoneNumber;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
public class UserCaptchaController {
    @Autowired
    private UserService userService;

    @PostMapping("/validateCode/send4Login")
    public R sendCaptcha( String telephone) {
        userService.sendCaptcha(telephone);
        return R.success(null);
    }

    @PostMapping("/member/login")
    public R quickLogin( @RequestBody PhoneNumber phoneNumber) {
        userService.quickLogin(phoneNumber);
        return R.success(null);
    }
}